CC=arm-apple-darwin-gcc
LD=$(CC)
LDFLAGS=-lobjc -lsqlite3 -dynamiclib -bind_at_load -F/System/Library/PrivateFrameworks -F/System/Library/Frameworks -framework CoreTelephony -framework CoreFoundation -framework Foundation -framework UIKit -framework CoreGraphics -framework SystemConfiguration 

LDFLAGS=-lobjc \
  -F/System/Library/Frameworks \
  -framework CoreFoundation \
  -framework Foundation \
  -framework UIKit \
  -framework CoreGraphics \
  -L/usr/lib -lc /usr/lib/libgcc_s.1.dylib \
  -bind_at_load \
  -multiply_defined suppress \
  -dynamiclib \
  -lsqlite3 -F/System/Library/PrivateFrameworks -framework CoreTelephony -framework SystemConfiguration



CFLAGS=-fsigned-char -g -ObjC -fobjc-exceptions \
  -Wall -Wundeclared-selector -Wreturn-type -Wnested-externs \
  -Wredundant-decls \
  -Wbad-function-cast \
  -Wchar-subscripts \
  -Winline -Wswitch -Wshadow \
  -D_CTYPE_H_ \
  -D_BSD_ARM_SETJMP_H \
  -D_UNISTD_H_ \
  -fconstant-cfstrings -std=c99 -Wall -O2 -I/var/sdk/include



VERSION=1.0

all:    Toggle.dylib

Toggle.dylib: SBS_NoRotation.o
		$(LD) $(LDFLAGS) -o $@ $^
		/usr/bin/ldid -S Toggle.dylib

%.o: %.m
		$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

%.o: %.c
		$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

clean:
		rm -f *.o Toggle.dylib
